package com.it.zhangjun.design.pattern.visitor;

/**
 * @className: Client
 * @description: TODO 类描述
 * @author: z00018123
 * @date: 2021/4/30
 **/
public class Client {
    public static void main(String[] args) {
        Apple apple = new Apple();
        Orange orange = new Orange();
        Banana banana = new Banana();
        //个人套餐价格
        PersonVisitor personVisitor = new PersonVisitor();
        new ConcretePackage(apple, orange, banana).accept(personVisitor);
        System.out.println("个人套餐价格：" + personVisitor.totalPrice);
        //公司套餐价格
        GroupVisitor groupVisitor = new GroupVisitor();
        new ConcretePackage(apple, orange, banana).accept(groupVisitor);
        System.out.println("公司套餐价格：" + groupVisitor.totalPrice);
    }
}
